def my(leixing,shuzhi):
    def double(shuzhi):
        return shuzhi*2
    def myAdd(shuzhi):
        return shuzhi+10
    def myElse(shuzhi):
        return -shuzhi
    if leixing=="a" :
        return double(shuzhi)
    elif leixing=="add":
        return myAdd(shuzhi)
    else:
        return myElse(shuzhi)


print(my("a",5))
print(my("add",50))
print(my("myElse",-6))
print(my("sadfadfadf",9))

















# def computer(type,n):
#     def double(n):
#         return 2*n
#     def half(n):
#         return n/2
#     def sqr(n):
#         return n*n
    
#     if type=="double":
#         return double(n)
#     elif type=="half":
#         return half(n)
#     else:
#         return sqr(n)

# print(computer("half",10))
# print(computer("double",10))
# print(computer("sqr",10))